package com.healthy.service;

import com.healthy.entity.TestInformation;
import com.healthy.mapper.TestInformationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestInformationService {


    @Autowired
    TestInformationMapper testInformationMapper;

    //    查询全部
    public List<TestInformation> cuList() {
        return testInformationMapper.culist();
    }

    //    添加
    public TestInformation cuInsert(TestInformation testInformation) {

        testInformationMapper.cuInsert(testInformation);
        return testInformation;
    }

    //    删除
    public int cuDeleteByid(int id) throws Exception {
        int res = testInformationMapper.cuDeleteByid(id);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
    //    修改
    public int cuUpdateByid(int id,String name,String examination,String content,String doctor) throws Exception {
        int res = testInformationMapper.cuUpdateByid(id,name,examination,content,doctor);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
}
